
###############################################################################
## CuteTimer
## Speed-run plugin for EventScripts Python
## Officially supported games: CS:S OB
##
## File: core/messaging.py
## Author: zoomj
## Description: simple server messaging supporting translations
## Version: 0.1

import es
from cutetimer.core.interface import interface

__all__ = [
    'interface_MessageManager'
]

class MessageManager(object):
    _translations = {}
    
    def __init__(self):
        pass # set translations
        
    def dev(self, message, translation = None, *args):
        if translation and args:
            pass
        else:
            es.dbgmsg(0, message)
            
    
    def server(self, message, translation = None, *args):
        if translation and args:
            pass
        else:
            es.msg(message)
    
    def player(self, message, player, translation = None, *args):
        if translation and args:
            pass
        else:
            if hasattr(player, 'userid'):
                es.tell(player.userid, message)
            else:
                es.tell(player, message)

interface_MessageManager = MessageManager()
exposed = interface.iface_create('MessageManager', interface_MessageManager)
if not exposed:
    raise NameError('interface \'MessageManager\' not defined')
